<!DOCTYPE html>
<html>
<head>
	<title>测试并发</title>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0"/>
	<script type="text/javascript" src="http://zeptojs.com/zepto.min.js"></script>
</head>
<body>
	<div id="js_wrap"><h1>等待请求</h1></div>
	<script type="text/javascript">
		var wrap = $('#js_wrap');
		function sendRequest(index) {
			var url = 'ptest.php?index='+(index||0);
			$.post(url, { index: index||0 }, function(res){
				wrap.append('<p>'+url+'&nbsp;&nbsp;&nbsp;&nbsp;<b>'+JSON.stringify(res)+'</b></p>');
			});
		}
		for(var i = 0; i< 100; i++) {
			sendRequest(i);
		}
	</script>
</body>
<html>
